package controllers

import (
	"gitee.com/small_fish_official_net/more_wechat/model/https"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/logs"
	"net/http"
)

type MainController struct {
	beego.Controller
}

var cookies []*http.Cookie

func (c *MainController) Get() {
	logs.Info(https.Get("https://wx.qq.com/?&lang=zh_CN"))
	//root_url := "https://wx.qq.com/?&lang=zh_CN"
	//client := &http.Client{}
	//// 设置cookie信息
	//var req *http.Request
	//req,err := http.NewRequest("get",root_url,nil)
	//if err != nil {
	//	logs.Error("网络请求构建失败")
	//	return
	//}
	//// 设置Header头信息
	//req.Header.Add("Accept-Language","zh-CN,zh;q=0.9")
	//req.Header.Add("User-Agent","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36")
	//// 开始处理请求
	//resp,err := client.Do(req)
	//if err != nil {
	//	logs.Error("网络请求构建失败")
	//	return
	//}
	//defer resp.Body.Close()
	//cookies = resp.Cookies()
	//b,_ := ioutil.ReadAll(resp.Body)
	//root_url = "https://login.wx.qq.com/"
	//urls := "/jslogin?appid=wx782c26e4c19acffb&fun=new&lang=zh_CN&_="+fmt.Sprintf("%d",time.Now().Unix())+"&redirect_uri="
	//logs.Info(urls)
	////logs.Info(string(b))



	//c.Data["Html"] = string(b)
	//c.Data["Email"] = "astaxie@gmail.com"
	c.TplName = "index.tpl"
}
